<extend name="Public/base" />

<!-- 子导航 -->
<block name="sidebar">
	<include file="sidemenu" />
</block>

<block name="body">
	<style>
		.main-title h2 {
			padding: 10px 0 10px 20px;
		}
		
		.columns-mod .bd {
			height: auto;
		}
	</style>
	<script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
	<div class="main-title cf">

		<h2>
			客户名称：刘德华
		</h2>

		</ul>
	</div>
	<!-- 标签页导航 -->
	<div class="tab-wrap">

		<div class="tab-content">
			<!-- 表单 -->
			<div class="container-span">
				<div class="span2">
					<div class="columns-mod">
						<div class="hd cf">
							<h5>系统信息</h5>
							<div class="title-opt">
							</div>
						</div>
						<div class="bd">
							<div class="sys-info">
								<table>
									<tbody>
										<tr>
											<th>香茗</th>
											<td>{$data.name}</td>
										</tr>
										<tr>
											<th>联系人</th>
											<td>{$data.contacts}</td>
										</tr>
										<tr>
											<th>前负责人</th>
											<td>{$data.before_principal_id}</td>
										</tr>
										<tr>
											<th>邮箱</th>
											<td>{$data.email}</td>
										</tr>
										<tr>
											<th>联系地址</th>
											<td>{$data.address}</td>
										</tr>
										<tr>
											<th>创建时间</th>
											<td>{$data.create_time}</td>
										</tr>
										<tr>
											<th>协作发起人</th>
											<td>{$data.sponsor_uid}</td>
										</tr>
										<tr>
											<th>客户类型</th>
											<td>{$data.customer_type}</td>
										</tr>
										<tr>
											<th>当前跟进状态</th>
											<td>{$data.follow_status}</td>
										</tr>
									</tbody>
								</table>
							</div>
						</div>
					</div>
				</div>
				<div class="span2">
					<div class="columns-mod">
						<div class="hd cf">
							<h5>产品团队</h5>
							<div class="title-opt">
							</div>
						</div>
						<div class="bd">
							<div class="sys-info">
								<table>
									<tbody>
										
								<volist name="genjin" id="tdd">
									<tr>
											<th>跟进状态：<switch name="tdd.status">
    <case value="1">感兴趣</case>
    <case value="2">意向强烈</case>
      <case value="3">近期合作</case>
    <case value="4">成交</case>  
       <case value="5">半死不活</case>
    <case value="26">未成交</case>    
    
    <default />暂无数据
</switch></th>
											<td>提交人：{$tdd.content}</td>
											<td><a target="_blank" href="{:U('Article/xiangqingbox','id='.$tdd['id'])}">详情</a></td>
											
									</tr>
                        </volist>
										 
									</tbody>
								</table>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</block>

<block name="script">
	<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
	<php>if(C('COLOR_STYLE')=='blue_color') echo '
		<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">';</php>
	<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
	<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
	<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
	<script type="text/javascript">
		Think.setValue("type", {
			$data.type |
			default = '""'
		});
		Think.setValue("display", {
			$data.display |
			default = 0
		});

		$('#submit').click(function() {
			$('#form').submit();
		});

		$(function() {
			$('.date').datetimepicker({
				format: 'yyyy-mm-dd',
				language: "zh-CN",
				minView: 2,
				autoclose: true
			});
			$('.time').datetimepicker({
				format: 'yyyy-mm-dd hh:ii',
				language: "zh-CN",
				minView: 2,
				autoclose: true
			});
			showTab();

			<
			if condition = "C('OPEN_DRAFTBOX') and (ACTION_NAME eq 'add' or $data['status'] eq 3)" >
				//保存草稿
				var interval;
			$('#autoSave').click(function() {
				var target_form = $(this).attr('target-form');
				var target = $(this).attr('url')
				var form = $('.' + target_form);
				var query = form.serialize();
				var that = this;

				$(that).addClass('disabled').attr('autocomplete', 'off').prop('disabled', true);
				$.post(target, query).success(function(data) {
					if(data.status == 1) {
						updateAlert(data.info, 'alert-success');
						$('input[name=id]').val(data.data.id);
					} else {
						updateAlert(data.info);
					}
					setTimeout(function() {
						$('#top-alert').find('button').click();
						$(that).removeClass('disabled').prop('disabled', false);
					}, 1500);
				})

				//重新开始定时器
				clearInterval(interval);
				autoSaveDraft();
				return false;
			});

			//Ctrl+S保存草稿
			$('body').keydown(function(e) {
				if(e.ctrlKey && e.which == 83) {
					$('#autoSave').click();
					return false;
				}
			});

			//每隔一段时间保存草稿
			function autoSaveDraft() {
				interval = setInterval(function() {
					//只有基础信息填写了，才会触发
					var title = $('input[name=title]').val();
					var name = $('input[name=name]').val();
					var des = $('textarea[name=description]').val();
					if(title != '' || name != '' || des != '') {
						$('#autoSave').click();
					}
				}, 1000 * parseInt({: C('DRAFT_AOTOSAVE_INTERVAL')
				}));
			}
			autoSaveDraft();

			<
			/if>

		});
	</script>
</block>